package com.gdou.crrp.repository;

import com.gdou.crrp.entity.Department;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface DepartmentRepository extends JpaRepository<Department, Integer> {

    //根据医院id查找所有科室
    List<Department> findByHid(Integer hid);

    //根据医院id和科室名称查找科室
    Department findByNameAndHid(String name, Integer hid);

    //根据医院id和科室模糊名字查找匹配科室
    List<Department> findByHidAndNameLike(int id, String name);
}
